package javaee.synchronize;

/**
 * @author tongchen
 * @create 2023-04-11 23:52
 */
public class SynchronizedResult {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 =new Thread(()->{
            increase();
        });
        t1.start();
        increase();

        t1.join();
        System.out.println(count);
    }
    public static int count=0;
    public static   synchronized void increase(){
        synchronized (SynchronizedResult.class){
            for (int i=0;i<50000;++i){
                count++;
            }
        }


    }
}
